//
//  DiscoverCollectionViewCellOfContentViewSixth.m
//  XYFMApp
//
//  Created by 岁变 on 16/8/31.
//  Copyright © 2016年 岁变. All rights reserved.
//

#import "DiscoverCollectionViewCellOfContentViewSixth.h"
#import "XYMacro.h"

@implementation DiscoverCollectionViewCellOfContentViewSixth

- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        _picImageView = [[UIImageView alloc] init];
        _picImageView.clipsToBounds = YES;
        [self.contentView addSubview:_picImageView];
    }
    return self;
}

- (void)setModel:(DiscoverModelSecondContant *)model {
    
    [_picImageView sd_setImageWithURL:[NSURL URLWithString:model.channel_img1] placeholderImage:PLACEHOLDERIMAGE];
    
}

- (void)layoutSubviews {
    
    [super layoutSubviews];
    [_picImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).with.offset(0);
        make.left.equalTo(self.contentView.mas_left).with.offset(0);
        make.right.equalTo(self.contentView.mas_right).with.offset(0);
        make.bottom.equalTo(self.contentView.mas_bottom).with.offset(0);
    }];
    [_picImageView layoutIfNeeded];
    _picImageView.layer.cornerRadius = _picImageView.frame.size.width / 2;
    
}

@end
